<%--
    Created on : 2019
    Author     : 黄忠
--%>

<%@page import="dateManager.LookDateBean"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>个人信息管理系统->删除日程</title>
    <link rel="stylesheet" href="../CSS/infor.css">
</head>
<body bgcolor="CCCFFF">
<br><br>
    <%
        ArrayList datelist=(ArrayList)session.getAttribute("datelist");
        if(datelist==null||datelist.size()==0){
    %>
    <div align="center">
        <h1>您还没有任何日程！</h1>
    </div>
    <%
    }else{
    %>
<table cellspacing="0" cellpadding="0" style="width: 99%;" align="center">
    <tr>
        <th>日程时间</th>
        <th>日程内容</th>
        <th>操作</th>
    </tr>
</table>
<table id="pageMain"cellspacing="0" cellpadding="0" style="width: 99%;" align="center">
    <%
        for(int i=datelist.size()-1;i>=0;i--){
            LookDateBean ff=(LookDateBean)datelist.get(i);
    %>
    <tr class="hoverTr">
        <td><%=ff.getDate()%></td>
        <td><%=ff.getThing()%></td>
        <td><a href="#" onclick="deleteCall(<%="'"+ff.getDate()+"'"%>)">删除</a></td>
    </tr>
    <%
            }
        }
    %>
</table>
</body>
<%@include file="../page.jsp" %>
</html>
<script>
    function deleteCall(userName) {
        var result=confirm('您确定要删除'+userName+'吗？');
        if(result){
            window.open("http://localhost:8080/DeleteDateServlet?date="+userName,"main");
        }
    }
</script>

